﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace EBQComm
{
    public class BrowserChecker
    {
        private static string[] browsers = { "iexplore", "chrome", "firefox", "baidubrowser", "sogouexplorer", "The world", "opera", "360SE", "Safari", "Maxthon", "Netscape" };
        public static bool Check(){
            //全部进程
            Process[] ps = Process.GetProcesses();
            foreach (Process p in ps)
            {
                String name = p.ProcessName;//进程名
                if (Contain(name))//如果包含返回失败
                {
                    return false;
                }
            }
            return true;
        }

        public static bool Contain(string name) {
            foreach (string p in browsers)
            {
                if(name.ToUpper().IndexOf(p.ToUpper()) >= 0){
                    return true;
                }
            }
            return false;
        }
    }
}
